﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ListaCasamento._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
    body { font-family: Arial; font-size:12px; border:0px; }
    ul li {
    border-color: black; border-style: dashed; border-width: 1px; display: inline; float: left; height: 310px; 
    list-style: none outside none; margin: 10px; padding: 10px; width: 232px; }
    ul li img { height:100px; }
    .presente { position: relative; font-weight:bolder; font-size:10pt; margin-bottom:10px; margin-top:15px; color:#CD45A0; font-family: Tahoma; }
    .sugestoes { color: Gray; margin-bottom: 15px; }
    .modelo { margin-bottom: 10px; }
    #lista-presentes { width: 820px; margin: 0px; }
    #conteudo { font-family: Book Antiqua; }
   .txtOff { font-size: 12px; width: 150px; height: 19px; color: gray; }
    .btn { background-color: #DD82BE; color: white; border-width: 0px; height: 25px; width: 75px; font-family: Arial; font-size: 10pt; }
    #categorias-presentes { background-color: #CD45A0; height: 40px; color: #FFFFFF; vertical-align:middle; 
                            font-family:Tahoma; font-weight:bold; padding: 5px; font-size: 14pt; }
    #esquerda { position:absolute; padding-left: 550px; padding-top: 70px;}
    .text-topo-lista { font-family: Arial; font-weight:bold; }
    .text-topo-lista .big { font-size: 20px; }
    .text-topo-lista .small { color:#C6288A; }
    </style>
    <script src="js/jquery.min.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            $('.btn').click(function () {
                var idPresente = $(this).attr('id').toString().replace('btnOfertante_', '');
                var nomeOfertante = $('#txtOfertante_' + idPresente.toString()).attr('value');

                $.ajax({
                    type: "POST",
                    url: "Service.asmx/SalvarOfertante",
                    data: "{'id':'" + idPresente + "', 'nome':'" + nomeOfertante + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (msg, status) {
                        alert('Obrigado!');
                        window.location = "Default.aspx";
                    },
                    error: function (xhr, msg, e) {
                        alert(msg);
                    }
                });

            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">

        <div id="lista-presentes">
            <div class="text-topo-lista">
            <span class="big">Nossa lista de desejos</span><br />
            <span class="small">Para confirmar o presente, digite seu nome no campo e clique em Confirmar.</span>
            </div>
            <div id="divPages" runat="server" class="paginacao"></div>
            <ul style="clear: both; margin-left: -50px;" runat="server" id="ulPresentes">
                
            </ul>
        </div>
        <div style="position:absolute; margin-left:820px;"><img src="images/pngzado.png" style="width:550px" /></div>
    </form>
</body>
</html>
